<%@ page language="java" import="cn.hutool.core.util.StrUtil" pageEncoding="UTF-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.engine.encrypt.biz.DecryptResourceComInfo" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<%--获取登录用户手机号--%>
<%
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<%
    BaseBean baseBean = new BaseBean();
    String loginid = Util.null2String(request.getParameter("loginid"));
    baseBean.writeLog(">>>>>getTelPhone>>>>>loginid="+loginid);
    Map<String, Object> apidatas = new HashMap<String, Object>();
    String hiddenPhoneNumber = "";
    try {
        if (!"".equals(loginid)) {
            rs.execute("select id,mobile from hrmresource where loginid='"+loginid+"'");
            if(rs.next()){
                String id = Util.null2String(rs.getString("id"));
                String mobile = Util.null2String(rs.getString("mobile"));
                if(mobile.length() > 11){
                    DecryptResourceComInfo decryptResourceComInfo = new DecryptResourceComInfo();
                    String decmobile =decryptResourceComInfo.getMobile(id);
                    hiddenPhoneNumber = StrUtil.hide(decmobile, 3, 7);
                }else {
                    hiddenPhoneNumber = StrUtil.hide(mobile, 3, 7);
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    apidatas.put("mobile", hiddenPhoneNumber);
    out.print(JSONObject.toJSONString(apidatas));
%>



